<?php

class opensolr_events_config{
    
    public function __construct(){
        
        // Solr connection and geohashing parameters
        $this->geohash_server = 'http://ezcmd.com/apps/api_geo_postal_codes/nearby_locations_by_zip_code/GUEST_USER/-1';
        $this->geoash_server_by_address = 'http://ezcmd.com/apps/api_geo_postal_codes/search/GUEST_USER/-1';
        
        $this->solr_server = 'http://us.opensolr.com/solr/my_solr_core';
        
        
        /* 
         * Add to this to index other fields as other types.
         * For instance any other zip code or postal code
         * fields should be GEOHASH types: 'field_other_zip_code' => 'GEOHASH'
         * Possible types are DATE, GEOHASH, FULLTEXT and COLLECTION
         * All the rest are auto-detected.
         */
        $this->custom_indexed_fields = array(
        
            'field_publish_date' => 'DATE',
            
            'field_zip_code' => 'GEOHASH', // Geohash transforms zip codes into lat/long coords and will index those to your opensolr collection
            'field_description' => 'FULLTEXT', // Fulltext fields should be specified here so that solr knows to index them as such            
            
            'field_article_image' => 'COLLECTION' // In case you are using a drupal field collection, you should specify it here
            
            
        );
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        /* ==================================================================== */
        // Do not touch the stuff below
        $this->indexed_fields = array(
            'nid',
            'title',
            'body',
            'status',
            'promote',
            'log',
            'type',
            'created',
            'changed',
            'field_'
        );
        $solr_url = parse_url($this->solr_server);
        $this->solr = new Apache_Solr_Service($solr_url['host'], 80, $solr_url['path']);
    }
    
    public function get($param = "solr_server"){
        return $this->$param;
    }
    
    public function set($param = "solr_server"){
        $this->$param = $param;
        return $this->get($param);
    }
}
